package com.sfzlot.dev.netty.bean.bussiness;

/**
 * Created by ASUS on 2017/5/27.
 * 行业大类
 */
public enum Industry {
	RETAILSERVICE(0x05),// 零售服务
	SMARTFAMILY(0x08); 	// 智慧家庭

    public int getCode() {
		return code;
	}

	private int code;
	Industry(int code){
        this.code = code;
    }

    /**
     * 根据code获取数据单元加密方式
     * @param code
     * @return
     */
	public static Industry get(int code){
        for (Industry industry : Industry.values()) {
            if (industry.code == code) {
                return industry;
            }
        }
        return null;
    }
	
	 /**
     * 根据码获取命令对应的备注
     * 
     */
    public String getComment(){
    	switch (this) {
			case SMARTFAMILY:
				return "智慧家庭";
		default:
			break;
    	}
		return null;
    }
}
